import request from '@/utils/request';

// 查询专题列表
export function listTopic(query) {
	return request({
		url: '/mall/topic/list',
		method: 'post',
		data: query,
	});
}

// 查询专题详细
export function getTopic(id) {
	return request({
		url: '/mall/topic/getInfo',
		method: 'post',
		data: { id: id },
	});
}

// 新增专题
export function addTopic(data) {
	return request({
		url: '/mall/topic/add',
		method: 'post',
		data: data,
	});
}

// 编辑专题
export function updateTopic(data) {
	return request({
		url: '/mall/topic/edit',
		method: 'post',
		data: data,
	});
}

// 删除专题
export function delTopic(id) {
	return request({
		url: '/mall/topic/remove',
		method: 'post',
		data: { id: id },
	});
}

// 导出专题
export function exportTopic(query) {
	return request({
		url: '/mall/topic/export',
		method: 'post',
		params: query,
	});
}
